<?php
function is_course($st){
	include("connect.inc");
	$sql1="select tenhp from hp where mahp='$st'";
	mysql_query("SET NAMES 'UTF8'");
	$rs=mysql_query($sql1,$con);
	$row=mysql_fetch_array($rs);
	return $row["tenhp"];
}

function is_student($st){
	include("connect.inc");
	$sql1="select hoten from sv where maso='$st'";
	mysql_query("SET NAMES 'UTF8'");
	$rs=mysql_query($sql1,$con);
	$row=mysql_fetch_array($rs);
	return $row["hoten"];
}

function is_teacher($st){
	include("connect.inc");
	$sql2="select hoten from gv where magv='$st'";
	mysql_query("SET NAMES 'UTF8'");
	$rs=mysql_query($sql2,$con);
	$row=mysql_fetch_array($rs);
	return $row["hoten"];
}

function createMenu($st){
	include("connect.inc");
	$sql3="select * from pc,hp where magv='$st' and left(pc.malhp,3)=hp.mahp";
	mysql_query("SET NAMES 'UTF8'");
	$rs=mysql_query($sql3,$con);
	if(mysql_num_rows($rs)>0){
	    echo "<form method=post action=bangdiemhp.php>";	
	    echo "<select name=lhp>";	
	    while($row=mysql_fetch_array($rs)){
		echo "<option value=".$row['malhp'].">".$row['tenhp']."</option>";
	    }
            echo "</select>";
	    echo "<input type=submit value='OK'>";
	    echo "</form>";
	}			
}
?>